namespace KYO.DAL {
    using System;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    
    public partial class ModuleIntall : ObjectPersistence.ORNetBaseType {
        public ModuleIntall() {
        }
        public ModuleIntall(int ModuleId, string Name) {
            this.ModuleId = ModuleId;
            this.Name = Name;
        }
        public ModuleIntall(int ID, int ModuleId, string Name) {
            this.ID = ID;
            this.ModuleId = ModuleId;
            this.Name = Name;
        }

        public int ID {
            get {
                return _ID;
            }
            set {
                this._ID = value;
                this.ChangesMade = true;
            }
        }
        public int ModuleId {
            get {
                return _ModuleId;
            }
            set {
                this._ModuleId = value;
                this.ChangesMade = true;
            }
        }
        public string Name {
            get {
                return _Name;
            }
            set {
                this._Name = value;
                this.ChangesMade = true;
            }
        }

        public KYO.DAL.Module ModuleObject {
            get {
                if ((_ModuleObject == null)) {
                    if (IsNew) {
                        _ModuleObject = new KYO.DAL.Module();
                    }
                    else {
                        ObjectPersistence.ModuleIntallAssembler _tempAssem = new ObjectPersistence.ModuleIntallAssembler();
                        _ModuleObject = _tempAssem.GetModuleObject(ModuleId);
                    }
                }
                return _ModuleObject;
            }
            set {
                if ((value == null)) {
                    throw new Exception("Error, this object cannot be set to null, since the FK properties which point to " +
                            "it are not nullable.");
                }
                else {
                    this.ModuleId = value.ModuleId;
                }
                this._ModuleObject = value;
            }
        }

        public BusinessLayerHelper.PersistentList<KYO.DAL.Tab> TabColl {
            get {
                if ((_TabColl == null)) {
                    if (IsNew) {
                        _TabColl = new BusinessLayerHelper.PersistentList<KYO.DAL.Tab>();
                    }
                    else {
                        ObjectPersistence.ModuleIntallAssembler _tempAssem = new ObjectPersistence.ModuleIntallAssembler();
                        _TabColl = _tempAssem.GetTabColl(ID);
                    }
                }
                return _TabColl;
            }
            set {
                this._TabColl = value;
            }
        }


        private int _ID;
        private int _ModuleId;
        private string _Name;
        private KYO.DAL.Module _ModuleObject;
        private BusinessLayerHelper.PersistentList<KYO.DAL.Tab> _TabColl;


        public bool IsModuleObjectNull() {
            return (this._ModuleObject == null);
        }
        public bool IsTabCollNull() {
            return (this._TabColl == null);
        }
        public string ROKeyString {
            get {
                return ("KYO.DAL.ModuleIntall" + ID.ToString());
            }
        }

    }
}
